Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

完善插件管理器的消息处理机制并启用多个插件 #1382

Open
wants to merge 34 commits into
base: refactoring-v3-mvp
Choose a base branch
from

Conversation

chuanSir123
Copy link

@chuanSir123 chuanSir123 commented Jan 3, 2025

主要更新:

  1. 完善插件管理器的消息处理机制
  2. 增加自动工作流插件
  3. 增加图片生成插件
  4. 增加提示词增强插件
  5. 增加音乐插件
  6. 增加天气插件

Summary by Sourcery

实现对多个插件的支持并改进插件管理器的消息处理机制。

新功能:

  • 添加了自动工作流插件。
  • 添加了图像生成插件。
  • 添加了提示增强插件。
  • 添加了音乐插件。
  • 添加了天气插件。
Original summary in English

Summary by Sourcery

Implement support for multiple plugins and improve the message handling mechanism of the plugin manager.

New Features:

  • Added an automatic workflow plugin.
  • Added an image generation plugin.
  • Added a prompt enhancement plugin.
  • Added a music plugin.
  • Added a weather plugin.

lss233 and others added 19 commits September 8, 2023 15:02
添加 SUCCESS 和 FAILED 的情况
{"result": "SUCCESS", "message": [], "voice": [], "image": []}

{"result": "FAILED", "message": ["\u6ca1\u6709\u66f4\u591a\u4e86\uff01"], "voice": [], "image": []}
1.完善HTTP API的session_id说明
2.兼容不规范的session_id
3.兼容不规范的request_id
如:
[sdwebui.alwayson_scripts.ADetailer]
args = [{ad_model = "face_yolov8n.pt"},{ad_model = "hand_yolov8n.pt"}]
…toring-v3-mvp

# Conflicts:
#	bot.py
#	config.py
#	conversation.py
#	drawing/sdwebui.py
#	manager/ratelimit.py
#	middlewares/draw_ratelimit.py
#	middlewares/ratelimit.py
#	platforms/http_service.py
#	requirements.txt
#	universal.py
#	utils/text_to_img.py
1. 完善插件管理器的消息处理机制
2. 优化全局配置结构,支持插件配置

具体改动:
- 完善了插件系统的消息处理注册机制
- 优化了配置文件结构,增加了插件启用配置
主要变更:
1. 新增 llms 配置部分,添加 OpenAI 后端配置
   - 支持自定义 API 密钥、基础URL和模型
   - 默认配置使用 claude-3.5-sonnet 模型
2. 更新插件配置,启用以下插件:
   - onebot_adapter
   - openai_adapter
   - workflow_plugin
   - prompt_generator
   - image_generator
   - music_player
   - weather_query
Copy link
Contributor

sourcery-ai bot commented Jan 3, 2025

🧙 Sourcery 已完成对您的拉取请求的审查!


提示和命令

与 Sourcery 交互

  • 触发新的审查: 在拉取请求中评论 @sourcery-ai review
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 从审查评论生成 GitHub 问题: 通过回复审查评论,要求 Sourcery 创建一个问题。
  • 生成拉取请求标题: 在拉取请求标题的任何位置写 @sourcery-ai 以随时生成标题。
  • 生成拉取请求摘要: 在拉取请求正文的任何位置写 @sourcery-ai summary 以随时生成 PR 摘要。您还可以使用此命令指定摘要应插入的位置。

自定义您的体验

访问您的仪表板以:

  • 启用或禁用审查功能,如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审查语言。
  • 添加、删除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English

🧙 Sourcery has finished reviewing your pull request!


Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time. You can also use
    this command to specify where the summary should be inserted.

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@chuanSir123 - 我已经审查了您的更改 - 以下是一些反馈:

整体评论

  • 音乐播放器插件应该添加更强大的URL验证和错误处理,以防止处理无效或格式错误的URL时可能出现的运行时问题。
以下是我在审查期间查看的内容
  • 🟡 一般性问题:发现2个问题
  • 🟢 安全性:一切看起来都很好
  • 🟢 测试:一切看起来都很好
  • 🟢 复杂性:一切看起来都很好
  • 🟢 文档:一切看起来都很好

Sourcery 对开源项目是免费的 - 如果您喜欢我们的评论,请考虑分享 ✨
帮助我变得更有用!请在每条评论上点击 👍 或 👎,我将使用这些反馈来改进您的评论。
Original comment in English

Hey @chuanSir123 - I've reviewed your changes - here's some feedback:

Overall Comments:

  • The music player plugin should add more robust URL validation and error handling for failed requests to prevent potential runtime issues when dealing with invalid or malformed URLs.
Here's what I looked at during the review
  • 🟡 General issues: 2 issues found
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good
  • 🟢 Documentation: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Comment on lines +217 to +218
|voice| String[] |音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,,iVBORw0KGgoAAAANS...|
|image| String[] |图片返回,支持多个图片的base64编码;参考:data:image/png;base64,UhEUgAAAgAAAAIACAIA...|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议: Base64示例似乎被截断。

Base64的语音和图像示例似乎被截断。请完成这些示例或指明它们是占位符。

Suggested change
|voice| String[] |音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,,iVBORw0KGgoAAAANS...|
|image| String[] |图片返回,支持多个图片的base64编码;参考:data:image/png;base64,UhEUgAAAgAAAAIACAIA...|
|voice| String[] |音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,<base64_encoded_audio_data>|
|image| String[] |图片返回,支持多个图片的base64编码;参考:data:image/png;base64,<base64_encoded_image_data>|
Original comment in English

suggestion: Base64 examples seem truncated.

The base64 examples for voice and image appear truncated. Please complete these examples or indicate that they are placeholders.

Suggested change
|voice| String[] |音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,,iVBORw0KGgoAAAANS...|
|image| String[] |图片返回,支持多个图片的base64编码;参考:data:image/png;base64,UhEUgAAAgAAAAIACAIA...|
|voice| String[] |音频返回,支持多个音频的base64编码;参考:data:audio/mpeg;base64,<base64_encoded_audio_data>|
|image| String[] |图片返回,支持多个图片的base64编码;参考:data:image/png;base64,<base64_encoded_image_data>|

@@ -214,8 +214,8 @@ debug = false
|:---|:---|:---|
|result| String |SUCESS,DONE,FAILED|
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题(拼写错误): 拼写错误:SUCESS 应该是 SUCCESS。

Suggested change
|result| String |SUCESS,DONE,FAILED|
|result| String |SUCCESS,DONE,FAILED|
Original comment in English

issue (typo): Typo: SUCESS should be SUCCESS.

Suggested change
|result| String |SUCESS,DONE,FAILED|
|result| String |SUCCESS,DONE,FAILED|

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants